package com.ck.config;

import com.ck.core.interceptor.PermissionInterceptor;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.InterceptorRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;

/**
 * 节目客户端配置
 *
 * @author linqiang
 * @version v1.0
 * @date 2018-09-19 16:11
 */
@Configuration
public class ProgramClientConfig extends WebMvcConfigurerAdapter {
    @Override
    public void addInterceptors(InterceptorRegistry registry) {
        registry.addInterceptor(new PermissionInterceptor()).addPathPatterns("/**");
    }

    @Bean
    public PermissionInterceptor clientPermissionInterceptor() {
        return new PermissionInterceptor();
    }
}
